package com.yy.auth.server.config;

import com.yy.auth.server.service.ClientRegistrationService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;

/**
 * @Description 使用客户端注册服务
 * @Date 2025/10/11 下午2:47
 * @Author yanglin
 **/
@Configuration
public class SSOClientConfig {

    @Bean
    public RegisteredClientRepository registeredClientRepository(ClientRegistrationService clientService) {
        return clientService.registeredClientRepository();
    }

    @Bean
    public ClientRegistrationService clientRegistrationService(PasswordEncoder passwordEncoder) {
        return new ClientRegistrationService(passwordEncoder);
    }
}
